fix(k8s): make helm test pods schedulable and probe CubeProxy healthz - #1388
fix(k8s): make helm test pods schedulable and probe CubeProxy healthz#1388fslongjin wants to merge 1 commit into
Conversation
Test pods that only talk to Services/the API now share cube.testPlacement (both plane taint tolerations, no nodeSelector) so they stay schedulable on control-only, compute-only, and mixed topologies. node-runtime-test keeps computePlacement and pins runAsUser 0 for hostPath sockets. proxy-control-test probes /admin/healthz; dns-test uses getent ahostsv4. Signed-off-by: jinlong <jinlong@tencent.com>
6091abd to
6b1272c
Compare
| a_record() { | ||
| n=0 | ||
| while [ "$n" -lt "$tries" ]; do | ||
| ip="$(getent ahostsv4 "$1" 2>/dev/null | awk 'NR==1 {print $1}')" |
There was a problem hiding this comment.
This test now depends on getent ahostsv4 + awk + sleep being present and behaving correctly in the curlimages/curl image (the dns container image switched from helmTest.dnsImage/busybox to helmTest.image). The new guard script (test-helm-test-guards.sh) only asserts the literal string getent ahostsv4 appears in the rendered YAML — it cannot catch a runtime image that lacks the applet or prints an incompatible format. This is the one test whose image contract changed, and the PR's own test plan lists both live helm test items (tainted single-node, multi-node compute) as not yet run.
Please complete those two test-plan items before merge, or at minimum confirm the image ships the needed tooling (e.g. docker run --rm curlimages/curl:8.10.1 getent ahostsv4 <host>), since a failure here makes helm test red on every DNS-enabled cluster.
| @@ -33,6 +34,8 @@ spec: | |||
| ca_path=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt | |||
| ns={{ .Release.Namespace | quote }} | |||
| kube_api="https://kubernetes.default.svc" | |||
There was a problem hiding this comment.
curl -4 now applies to every curl in the health-test script, including the kget() path to https://kubernetes.default.svc and the WebUI/proxy Service probes. On an IPv6-only or dual-stack cluster where kubernetes.default.svc resolves to an IPv6 ClusterIP (or only AAAA records are returned for the Service), these probes will fail where they previously worked — a functional regression, not just a stall. The AAAA-stall workaround is real, but consider scoping -4 to the specific probes that stall (the proxy/DNS hostname lookups) rather than the kube-API path, or falling back to IPv6 when the A record is absent.
Review: fix(k8s): make helm test pods schedulable and probe CubeProxy healthz (#1388)AI-generated review — this is a static analysis of the diff against the base branch; it is not a human approval. VerdictThe change is well-scoped and directly addresses the #1272 review blockers. The placement model is right:
The new guard script ( Findings1. (Medium) dns-test runtime tooling is not exercised by the guard — the two live-cluster test-plan items are still unchecked. 2. (Low–Medium) 3. (Low) 4. (Info) Notes that checked out clean
Bottom line: approve pending the two unchecked |
Summary
Supersedes #1272 (contributor went silent after review). Rebased onto current
masterand simplified the placement model.helm testpods that only talk to Services / the API now sharecube.testPlacement: the union of control-plane and compute taint tolerations, with no nodeSelector. That is what actually unsticks Pending pods on tainted nodes, without pinning a plane that the other topologies do not have.testPlacement(schedulable on control-only, compute-only, and mixed).computePlacement(hostPath sockets only exist on cube-node hosts). Skipped whencubeNode.enabled=false. PinsrunAsUser: 0/runAsGroup: 0so a non-root image override cannot silently failstat()./admin/healthzwithX-Cube-Admin-Tokenfrom the release Secret; capture curl exit; assert HTTP 200. No--retry-all-errors.helmTest.image(curlimages/curl) +getent ahostsv4with retries and diagnostics.helmTest.dnsImagestays busybox for node-runtime-test only.Addresses the #1272 review blockers: missing
runAsUser: 0, overstated topology claims,health-testPending on control-only,cubemastercli-testPending on compute-only.Original probe/DNS diagnosis is from #1272 (@try-agaaain).
Test plan
helm lint+deploy/kubernetes/chart/scripts/test-helm-test-guards.sh(default,cubeNode.enabled=false, compute-onlyexternalControlPlane,values-single-node.yaml)helm teston a control-plane-tainted single-node cluster withvalues-single-node.yamlhelm teston a multi-node cluster with compute nodesAssisted-by: Cursor:Grok-4.6
Made with Cursor